package cn.jarlen.jwt.tools.antivirus;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class AntivirusDatabaseHelper extends SQLiteOpenHelper {

    public static final String ACCOUNT_DB_NAME = "antivirus.db";

    /**
     * 每次增加字段，自增此字段 并且在onUpgrade 添加相关版本的ALTER SQL 语句
     */
    public static final int DB_VERSION = 1;

    public AntivirusDatabaseHelper(Context context) {
        super(context, ACCOUNT_DB_NAME, null, DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // db.execSQL(CVELib.buffer.toString());
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        for (int version = oldVersion + 1; version <= newVersion; version++) {
            switch (version) {
                case 2:
                    // upgrade2Version2(db);
                    break;
                default:
                    break;
            }
        }
    }

    //
    // /**
    //  * 升级版本2
    //  * 增加公司名称字段
    //  *
    //  * @param db
    //  */
    // void upgrade2Version2(SQLiteDatabase db) {
    //     String sql = "ALTER TABLE " + AccountEntity.ACCOUNT_TABLE_NAME + " ADD COLUMN " + AccountEntity.COLUMN_COMPANY_NAME + " TEXT";
    //     db.execSQL(sql);
    // }


}
